<template>
  <div>
    <div>
      <el-form
        :inline="true"
        :model="formInline"
      >
        <el-form-item label="文件路径">
          <el-input
            v-model.trim="formInline.path"
            placeholder="请输入文件路径"
          ></el-input>
        </el-form-item>
        <el-form-item>
          <el-button
            type="primary"
            @click="exportFile"
            :loading="btnLoading"
          >导出</el-button>
        </el-form-item>
      </el-form>
    </div>
    <MyDownload ref="myDownload" />
  </div>
</template>

<script>
import MyDownload from '@/components/download/MyDownload';
export default {
  components: { MyDownload },
  data() {
    return {
      formInline: {
        path: '',
      },
      btnLoading: false,
    };
  },
  methods: {
    exportFile() {
      if (this.formInline.path == '') {
        this.$message.error('文件路径必填~');
        return;
      }
      this.$refs.myDownload.downFile('/device/export', {
        path: this.formInline.path,
      });
    },
  },
};
</script>

<style lang="scss" scoped>
</style>